#include "../head/consoleform.h"
#include "ui_consoleform.h"

ConsoleForm::ConsoleForm(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::ConsoleForm)
{
    ui->setupUi(this);
    console = new Console;
    console->setEnabled(false);
    setWindowFlags(Qt::WindowCloseButtonHint|Qt::CustomizeWindowHint);
    //setCentralWidget(console);
    ui->formLayout->addWidget(console);
    this->setWindowTitle("解调数据");

}

void ConsoleForm::ConsoleData(QString data){

    if("DATA" == data){
        console->putData("\r\n");
    }else{
        data += " ";
        QByteArray qbyte = data.toUpper().toUtf8();
       console->putData(qbyte);
    }
}

ConsoleForm::~ConsoleForm()
{
    delete ui;
}
